package ooday03;
/** 接口的测试类 */
public class SwimTest {
    public static void main(String[] args) {
        Dog dog = new Dog("小黑", 2, "黑");
        dog.eat();      //Dog类重写之后的
        dog.drink();    //复用Animal类的
        dog.swim();     //Dog类重写之后的
        dog.lookHome(); //Dog类所特有的
        System.out.println();

        Chick chick = new Chick("小白", 1, "白");
        chick.eat();     //Chick类重写之后的
        chick.drink();   //复用Animal类的
        chick.layEggs(); //Chick类所持有的
        System.out.println();

        Fish fish = new Fish("小金", 1, "金");
        fish.eat();     //Fish类重写之后的
        fish.drink();   //复用Animal类的
        fish.swim();    //Fish类重写之后的
        System.out.println();

        Duck duck = new Duck("小红", 2, "红");
        duck.eat();
        duck.drink();
        duck.swim();
        duck.layEggs1();
        System.out.println();
    }
}
